package com.exm.sql.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.exm.sql.model.Record;
import com.exm.sql.model.vo.ResponseResult;
import com.exm.sql.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/record")
public class RecordController {


    @Autowired
    private RecordService recordService;

    @RequestMapping("/all")
    public ResponseResult findAll() {
        return recordService.findAll();
    }
    @RequestMapping("/delete")
    public ResponseResult deleteById(@RequestBody Long id) {
        return recordService.deleteById(id);
    }


    @RequestMapping("/save")
    public ResponseResult save(@RequestBody Record record) {
        return recordService.save(record);
    }


}
